Refactor: extract pure-logic base classes to prepare for async implementation#167
Open
abelmilash-msft wants to merge 1 commit into
Open
Refactor: extract pure-logic base classes to prepare for async implementation#167abelmilash-msft wants to merge 1 commit into
abelmilash-msft wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Extracts shared, I/O-free logic from the sync Dataverse OData and batch clients into new base classes to enable upcoming async client implementation while reducing duplication.
Changes:
- Added
_ODataBasewith URL/payload builders, caches, SQL guardrails, and lifecycle teardown. - Added
_BatchBasewith batch intent types plus multipart serialization/response parsing utilities. - Updated
_ODataClientand_BatchClientto inherit from the new base classes and adjusted a unit test patch target accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/data/test_sql_parse.py | Updates patch target to match the new urlparse location in _odata_base. |
| src/PowerPlatform/Dataverse/data/_odata_base.py | Introduces _ODataBase and shared helpers formerly in _odata.py. |
| src/PowerPlatform/Dataverse/data/_odata.py | Refactors _ODataClient to inherit shared “pure logic” from _ODataBase. |
| src/PowerPlatform/Dataverse/data/_batch_base.py | Introduces _BatchBase and moves intent types + multipart logic out of _batch.py. |
| src/PowerPlatform/Dataverse/data/_batch.py | Refactors _BatchClient to inherit batch serialization/parsing from _BatchBase. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vrathee-msft
previously approved these changes
May 6, 2026
f84ec5e to
a83a688
Compare
a83a688 to
a2f5f7d
Compare
- Reset to main (which is now PR #175) - Re-apply: _ODataBase, _BatchBase, _QueryBuilderBase, _BatchContext Protocol, _operation_context in base, Self type annotation - Re-export multipart helpers from _batch.py for test compatibility - Update test_sql_parse.py patch target to _odata_base.urlparse Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a2f5f7d to
e7df299
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts pure logic (URL building, payload construction, parsing, caches, multipart serialization) from the sync clients into shared base classes
_ODataBaseand_BatchBase. The sync clients now inherit from these bases. The async client (Phase 2) will inherit from the same bases as a sibling, enabling code sharing without the async client being a subtype of the sync client._ODataBase— pure logic extracted from_ODataClient; owns cache teardown and HTTP logger lifecycle viaclose()_BatchBase— pure logic extracted from_BatchClient; owns multipart serialization and response parsingTests
1369 passed
Total coverage: 94.35% (threshold: 90%)